package com.qinaxiwit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.netflix.discovery.converters.Auto;
import com.qianxi.wit.pojo.TbAdvertising;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qinaxiwit.mapper.TbAdvertisingMapper;
import com.qinaxiwit.service.TbAdvertisingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zqp
 * @since 2021-01-15
 */
@Service
public class TbAdvertisingServiceImpl extends ServiceImpl<TbAdvertisingMapper, TbAdvertising> implements TbAdvertisingService {

    @Autowired
    private TbAdvertisingMapper advertisingMapper;

    @Override
    public Page<TbAdvertising> register(int page, int size) {
        Page<TbAdvertising> page1 = new Page<>(page,size);

        QueryWrapper<TbAdvertising> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("contribution");

        advertisingMapper.selectPage(page1,wrapper);

        return page1;
    }
}
